package cn.tanfp.dynamicdatasource.service;
import cn.tanfp.dynamicdatasource.mapper.UserMapper;
import cn.tanfp.dynamicdatasource.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public List<User> findAll() {
        return userMapper.findAll();
    }

    public void addUser(String name) {
        User user = new User();
        user.setName(name);
        userMapper.addUser(user);
    }
}
